package com.sdx.console.saas.service;

import java.util.List;

import com.ibeetl.admin.core.service.BaseService;
import com.sdx.console.saas.dao.SaasTenantDao;
import com.sdx.console.saas.entity.SaasTenant;
import org.beetl.sql.core.engine.PageQuery;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;


/**
 * SaasTenant Service
 */

@Service
@Transactional
public class SaasTenantService extends BaseService<SaasTenant> {

    @Resource
	private SaasTenantDao saasTenantDao;

    public PageQuery<SaasTenant>queryByCondition(PageQuery query){
        PageQuery ret =  saasTenantDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelSaasTenant(List<String> ids){
        try {
            saasTenantDao.batchDelSaasTenantByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除SaasTenant失败", e);
        }
    }

	public List<SaasTenant> all() {
		return saasTenantDao.all();
		}
}